FROM fedora:latest

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Install required packages
RUN dnf update -y && \
    dnf groupinstall "Development Tools" -y && \
    dnf install -y \
    clang \
    clang-tools-extra \
    cmake \
    gdb \
    iproute \
    java-21-openjdk \
    libasan \
    libubsan \
    ninja-build \
    procps \
    which

# Create a non-root user to use if preferred
# see https://aka.ms/vscode-remote/containers/non-root-user.
RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME

# setup vcpkg
RUN git clone --depth=1 \
    --single-branch --branch=master \
    https://github.com/microsoft/vcpkg /home/$USERNAME/vcpkg \
    && /home/$USERNAME/vcpkg/bootstrap-vcpkg.sh \
    && /home/$USERNAME/vcpkg/vcpkg integrate install \
    && /home/$USERNAME/vcpkg/vcpkg install \
    fmt \
    gtest \
    leveldb \
    RapidJSON \
    spdlog \
    tbb

COPY Dockerfile /tmp/Dockerfile
